﻿using System.ComponentModel.DataAnnotations;

namespace Max.PH5_2011A.DTO
{
    public class ResponseResultDto<T>
    {
        public ResponseStateCode Code { get; set; } = ResponseStateCode.SUCCESS;
        public string? Message { get; set; } = "操作成功";
        public T? Data { get; set; }
    }


    public enum ResponseStateCode
    {
        #region 系统相关

        /// <summary>
        /// 操作成功
        /// </summary>
        [Display(Name = "操作成功")]
        SUCCESS = 200,

        /// <summary>
        /// 操作失败
        /// </summary>
        [Display(Name = "操作失败")]
        FAILED = 500,

        /// <summary>
        /// 参数无效
        /// </summary>
        [Display(Name = "参数无效")]
        PARAMNOVALID = -101,

        #endregion

        #region 用户（会员）有关的
        /// <summary>
        /// 用户名不存在
        /// </summary>
        [Display(Name = "用户名输有误")]
        USERNAMEERROR = -201,

        /// <summary>
        /// 用户名或密码错误
        /// </summary>
        [Display(Name = "密码错误")]
        USERPASSWORDERROR = -202,

        /// <summary>
        /// 用户被锁定
        /// </summary>
        [Display(Name = "用户被锁定")]
        USERLOCKED = -203,

        #endregion

        #region 库存相关

            /// <summary>
            /// 库存不足
            /// </summary>
            STOCKNOENOUGHT = - 210

        #endregion
    }
}